package com.betfair.wrapper.types;

import demo.util.InflatedMarketPrices;
import org.hibernate.annotations.Formula;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: markwilliams
 * Date: 10/19/13
 * Time: 3:45 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "Price", uniqueConstraints = {
        @UniqueConstraint(columnNames = "iPriceId")})
public class Price {
    int _id;
    InflatedMarketPrices.InflatedPrice _price = new InflatedMarketPrices.InflatedPrice();
    Runner _runner = new Runner();
    String _priceType;

    public Price() {
    }

    public Price(InflatedMarketPrices.InflatedPrice price) {
        this._price = price;
    }

    public Price(InflatedMarketPrices.InflatedPrice price, String priceType, Runner runner) {
        this._price = price;
        this._priceType = priceType;
        this._runner = runner;
    }

    @Id
    @GeneratedValue(generator="increment")
    @GenericGenerator(name="increment", strategy = "increment")
    @Column(name = "iPriceId")
    public int getId() {
        return _id;
    }

    public void setId(int id) {
        this._id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "iRunnerId", nullable = false)
    public Runner getRunner() {
        return _runner;
    }

    public void setRunner(Runner runner) {
        this._runner = runner;
    }

    public void setPrice(InflatedMarketPrices.InflatedPrice price) {
        this._price = price;
    }

    public double getPrice() {
        return _price.getPrice();
    }

    private void setPrice(double price){
    }

    public double getAmountAvailable() {
        return _price.getAmountAvailable();
    }

    private void setAmountAvailable(double param){
    }

    public int getDepth() {
        return _price.getDepth();
    }

    private void setDepth(int param){
    }

    public String getPriceType() {
        return _priceType;
    }

    public void setPriceType(String priceType) {
        this._priceType = priceType;
    }
}
